/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//package martino;

import java.util.HashMap;

/**
 *
 * @author sempere
 */
public class SymbolTable {
    HashMap<String, Symbol> elements;
    public static Symbol alwaysGenerating = new AlwaysTrueSymbol("__ALWAYS",Symbol.type.pushbutton);
    public static int currentGroup = 0;
    
    public SymbolTable(){
        elements = new HashMap();
	elements.put(alwaysGenerating.name,alwaysGenerating);
    }
    
    public Symbol addSymbol(Symbol newSymbol){
        elements.put(newSymbol.name, newSymbol);
        return newSymbol;
    }
    
    public void dropSymbol(String name){
        elements.remove(name);
    }
    
    public boolean containsSymbol(String name){
        return(elements.containsKey(name));
    }
    
    public Symbol get(String name){
        return(elements.get(name));
    }
}
